package api

import (
	"fmt"
	"io"
	"net/http"
	"strconv"
	"time"

	"github.com/labstack/echo"
	"github.com/jinzhu/gorm"
	_ "github.com/jinzhu/gorm/dialects/mysql"
	"github.com/mia0x75/mac/models"
)

var pool *core.Pool


//mysql pool factory
func factory() (io.Closer, error) {
	conn, err := gorm.Open("mysql", "root:@tcp(127.0.0.1:3306)/tickets?charset=utf8mb4&parseTime=True&loc=Local")
	if err != nil {
		return nil, err
	}
	return conn, nil
}

func init() {
	gorm.DefaultTableNameHandler = func (db *gorm.DB, defaultTableName string) string {
		return "mm_" + defaultTableName;
	}
}

func getOption(c echo.Context) error {
	return c.NoContent(http.StatusNoContent)
}

func updateOption(c echo.Context) error {
	return c.NoContent(http.StatusNoContent)
}

